//
//  StatisticalAnalysisCell.m
//  EMMApp
//
//  Created by Mac on 17/1/5.
//  Copyright © 2017年 YiXun. All rights reserved.
//

#import "StatisticalAnalysisCell.h"
#import "DecisionOneCellColl.h"


@implementation StatisticalAnalysisCell

- (void)awakeFromNib {
    [super awakeFromNib];
    _beijingTYView.backgroundColor=[UIColor whiteColor];
    //v.layer.masksToBounds=YES;这行去掉f87242
    _beijingTYView.layer.cornerRadius = 5;
    _beijingTYView.layer.shadowColor = [UIColor colorFromHexCode:@"#1A1A1A"].CGColor;
    _beijingTYView.layer.shadowOffset = CGSizeMake(0, 0);
    _beijingTYView.layer.shadowOpacity = 0.2;
    _beijingTYView.layer.shadowRadius = 3;

    _yBeiJingTYVIew.backgroundColor=[UIColor whiteColor];
    _yBeiJingTYVIew.layer.cornerRadius = 5;
    _yBeiJingTYVIew.layer.shadowColor = [UIColor colorFromHexCode:@"#1A1A1A"].CGColor;
    _yBeiJingTYVIew.layer.shadowOffset = CGSizeMake(0, 0);
    _yBeiJingTYVIew.layer.shadowOpacity = 0.2;
    _yBeiJingTYVIew.layer.shadowRadius = 3;
    
   
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)creatInitWithmXSPercentage:(NSString *)mXSPercentage
                    mXSContrastNum:(NSString *)mXSContrastNum
                     mHKPercentage:(NSString *)mHKPercentage
                    mHKContrastNum:(NSString *)mHKContrastNum
                     mZHPercentage:(NSString *)mZHPercentage
                    mZHContrastNum:(NSString *)mZHContrastNum
                     yXSPercentage:(NSString *)yXSPercentage
                    yXSContrastNum:(NSString *)yXSContrastNum
                     yHKPercentage:(NSString *)yHKPercentage
                    yHKContrastNum:(NSString *)yHKContrastNum
                     yZHPercentage:(NSString *)yZHPercentage
                    yZHContrastNum:(NSString *)yZHContrastNum {
    NSString *str = @"%";
    
    _mXSPercentageLabel.text = [NSString stringWithFormat:@"%@%@",mXSPercentage,str];
    _mHKPercentageLabel.text = [NSString stringWithFormat:@"%@%@",mHKPercentage,str];
    _mZHPercentageLabel.text = [NSString stringWithFormat:@"%@%@",mZHPercentage,str];
    
    _yXSPercentageLabel.text = [NSString stringWithFormat:@"%@%@",yXSPercentage,str];
    _yHKPercentageLabel.text = [NSString stringWithFormat:@"%@%@",yHKPercentage,str];
    _yZHPercentageLabel.text = [NSString stringWithFormat:@"%@%@",yZHPercentage,str];

    _mXSContrastNumLabel.text = mXSContrastNum;
    _mHKContrastNumLabel.text = mHKContrastNum;
    _mZHContrastNumLabel.text = mZHContrastNum;
    
    _yXSContrastNumLabel.text = yXSContrastNum;
    _yHKContrastNumLabel.text = yHKContrastNum;
    _yZHContrastNumLabel.text = yZHContrastNum;
    
    _mXSView.backgroundColor = [UIColor colorFromHexCode:@"#EFEFEF"];
    _mXSView.layer.masksToBounds = YES;
    _mXSView.layer.cornerRadius = 5;
    _mXSView.layer.borderWidth = 0.5;
    _mXSView.layer.borderColor = [[UIColor colorFromHexCode:@"#D7D7D7"] CGColor];
    
    _mHKView.backgroundColor = [UIColor colorFromHexCode:@"#EFEFEF"];
    _mHKView.layer.masksToBounds = YES;
    _mHKView.layer.cornerRadius = 5;
    _mHKView.layer.borderWidth = 0.5;
    _mHKView.layer.borderColor = [[UIColor colorFromHexCode:@"#D7D7D7"] CGColor];
    
    _mZHView.backgroundColor = [UIColor colorFromHexCode:@"#EFEFEF"];
    _mZHView.layer.masksToBounds = YES;
    _mZHView.layer.cornerRadius = 5;
    _mZHView.layer.borderWidth = 0.5;
    _mZHView.layer.borderColor = [[UIColor colorFromHexCode:@"#D7D7D7"] CGColor];
    
    _yXSView.backgroundColor = [UIColor colorFromHexCode:@"#EFEFEF"];
    _yXSView.layer.masksToBounds = YES;
    _yXSView.layer.cornerRadius = 5;
    _yXSView.layer.borderWidth = 0.5;
    _yXSView.layer.borderColor = [[UIColor colorFromHexCode:@"#D7D7D7"] CGColor];
    
    _yHKView.backgroundColor = [UIColor colorFromHexCode:@"#EFEFEF"];
    _yHKView.layer.masksToBounds = YES;
    _yHKView.layer.cornerRadius = 5;
    _yHKView.layer.borderWidth = 0.5;
    _yHKView.layer.borderColor = [[UIColor colorFromHexCode:@"#D7D7D7"] CGColor];
    
    _yZHView.backgroundColor = [UIColor colorFromHexCode:@"#EFEFEF"];
    _yZHView.layer.masksToBounds = YES;
    _yZHView.layer.cornerRadius = 5;
    _yZHView.layer.borderWidth = 0.5;
    _yZHView.layer.borderColor = [[UIColor colorFromHexCode:@"#D7D7D7"] CGColor];
    
    float mxsW = [mXSPercentage floatValue]*0.01;
    if (mxsW > 1) {
        mxsW = 1;
    }
    float mhkW = [mHKPercentage floatValue]*0.01;
    if (mhkW > 1) {
        mhkW = 1;
    }
    
    float mzhW = [mZHPercentage floatValue]*0.01;
    if (mzhW > 1) {
        mzhW = 1;
    }
    
    float yxsW = [yXSPercentage floatValue]*0.01;
    if (yxsW > 1) {
        yxsW = 1;
    }
    
    float yhkW = [yHKPercentage floatValue]*0.01;
    if (yhkW > 1) {
        yhkW = 1;
    }
    float yzhW = [yZHPercentage floatValue]*0.01;
    if (yzhW > 1) {
        yzhW = 1;
    }
    
    UIImageView *mXiaoSImageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, (EMM_WIDTH-30), _mXSView.frame.size.height)];
    mXiaoSImageV.image = [UIImage imageNamed:@"jianbian"];
    mXiaoSImageV.layer.masksToBounds = YES;
    mXiaoSImageV.layer.cornerRadius = 5;
    [_mXSView addSubview:mXiaoSImageV];
    
    UIImageView *mXiaoSImageV1 = [[UIImageView alloc] initWithFrame:CGRectMake((EMM_WIDTH-30) - (EMM_WIDTH-30) * (1-mxsW), 0, (EMM_WIDTH-30) * (1-mxsW), _mXSView.frame.size.height)];
    mXiaoSImageV1.backgroundColor = [UIColor colorFromHexCode:@"#EFEFEF"];
    [_mXSView addSubview:mXiaoSImageV1];
    
    
    UIImageView *mHKImageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, (EMM_WIDTH-30), _mHKView.frame.size.height)];
    mHKImageV.image = [UIImage imageNamed:@"jianbian"];
    mHKImageV.layer.masksToBounds = YES;
    mHKImageV.layer.cornerRadius = 5;
    [_mHKView addSubview:mHKImageV];
    
    UIImageView *mHKImageV1 = [[UIImageView alloc] initWithFrame:CGRectMake((EMM_WIDTH-30) - (EMM_WIDTH-30) * (1-mhkW), 0, (EMM_WIDTH-30) * (1-mhkW), _mHKView.frame.size.height)];
    mHKImageV1.backgroundColor = [UIColor colorFromHexCode:@"#EFEFEF"];
    [_mHKView addSubview:mHKImageV1];
    
    
    UIImageView *mZHImageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, (EMM_WIDTH-30), _mZHView.frame.size.height)];
    mZHImageV.image = [UIImage imageNamed:@"jianbian"];
    mZHImageV.layer.masksToBounds = YES;
    mZHImageV.layer.cornerRadius = 5;
    [_mZHView addSubview:mZHImageV];
    
    UIImageView *mZHImageV1 = [[UIImageView alloc] initWithFrame:CGRectMake((EMM_WIDTH-30) - (EMM_WIDTH-30) * (1-mzhW), 0, (EMM_WIDTH-30) * (1-mzhW), _mZHView.frame.size.height)];
    mZHImageV1.backgroundColor = [UIColor colorFromHexCode:@"#EFEFEF"];
    [_mZHView addSubview:mZHImageV1];
    
    
    UIImageView *yXiaoSImageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, (EMM_WIDTH-30), _yXSView.frame.size.height)];
    yXiaoSImageV.image = [UIImage imageNamed:@"jianbian"];
    yXiaoSImageV.layer.masksToBounds = YES;
    yXiaoSImageV.layer.cornerRadius = 5;
    [_yXSView addSubview:yXiaoSImageV];
    
    UIImageView *yXiaoSImageV1 = [[UIImageView alloc] initWithFrame:CGRectMake((EMM_WIDTH-30) - (EMM_WIDTH-30) * (1-yxsW), 0, (EMM_WIDTH-30) * (1-yxsW), _yXSView.frame.size.height)];
    yXiaoSImageV1.backgroundColor = [UIColor colorFromHexCode:@"#EFEFEF"];
    [_yXSView addSubview:yXiaoSImageV1];
    
    
    UIImageView *yHKImageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, (EMM_WIDTH-30), _yHKView.frame.size.height)];
    yHKImageV.image = [UIImage imageNamed:@"jianbian"];
    yHKImageV.layer.masksToBounds = YES;
    yHKImageV.layer.cornerRadius = 5;
    [_yHKView addSubview:yHKImageV];
    
    UIImageView *yHKImageV1 = [[UIImageView alloc] initWithFrame:CGRectMake((EMM_WIDTH-30) - (EMM_WIDTH-30) * (1-yhkW), 0, (EMM_WIDTH-30) * (1-yhkW), _yHKView.frame.size.height)];
    yHKImageV1.backgroundColor = [UIColor colorFromHexCode:@"#EFEFEF"];
    [_yHKView addSubview:yHKImageV1];
    
    
    UIImageView *yZHImageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, (EMM_WIDTH-30), _yZHView.frame.size.height)];
    yZHImageV.image = [UIImage imageNamed:@"jianbian"];
    yZHImageV.layer.masksToBounds = YES;
    yZHImageV.layer.cornerRadius = 5;
    [_yZHView addSubview:yZHImageV];
    
    UIImageView *yZHImageV1 = [[UIImageView alloc] initWithFrame:CGRectMake((EMM_WIDTH-30) - (EMM_WIDTH-30) * (1-yzhW), 0, (EMM_WIDTH-30) * (1-yzhW), _yZHView.frame.size.height)];
    yZHImageV1.backgroundColor = [UIColor colorFromHexCode:@"#EFEFEF"];
    [_yZHView addSubview:yZHImageV1];
}



@end
